import { Alert, message } from "antd";
import { CommonModal } from "@/views/components/CommonModal";
import { setRunningVolumeSku } from "@/pages/GoodsModule/systemGoods/service";

const SetDefaultRunningVolumeSkuModal = props => {
	const { fetchList, onCancel, selectedKeys } = props;
	const handleOk = () => {
		setRunningVolumeSku({ id: selectedKeys[0] }).then(res => {
			const { success, msg } = res;
			if (success) {
				message.success(msg);
				fetchList();
				onCancel();
			}
		});
	};
	return (
		<CommonModal title={{ title: "提示" }} open={true} width="400px" onOk={handleOk} onCancel={onCancel}>
			<Alert description="确定要将该跑量商品设为默认跑量商品么？" type="info" showIcon />
		</CommonModal>
	);
};
export default SetDefaultRunningVolumeSkuModal;
